package com.app.scale.bean;


import com.alibaba.fastjson.annotation.JSONField;

import java.util.ArrayList;

public class UserInfoList extends BaseListBean {



    private ArrayList<UserInfoBean> records = new ArrayList<UserInfoBean>();

    public ArrayList<UserInfoBean> getList() {
        return records;
    }

    public void setList(ArrayList<UserInfoBean> list) {
        this.records = list;
    }

    @JSONField(serialize = false)
    public void addListBean(UserInfoList listbean) {
        if (listbean == null)
            return;
        if (this.getCurrentPage() == INIT_PAGE) {
            setList(listbean.getList());
        } else {
            if (records == null)
                records = new ArrayList<UserInfoBean>();
            records.addAll(listbean.getList());
        }
        setListBeanData(listbean);
    }

    public boolean isJijiayuan(){
        boolean isJijiayuan =false;
        for (UserInfoBean user:getList()){
            switch (user.getUfs()){
                case "2":
//                    typeName = "计重员";
                    isJijiayuan = false;
                    break;
                case "3":
//                    typeName = "计价员";
                    isJijiayuan = true;
                    break;
                case "4":
//                    typeName = "管理员";
                    isJijiayuan = true;
                    break;
            }
        }
        return isJijiayuan;
    }


    public String getUNo(){
        String no ="";
        for (UserInfoBean userInfoBean : records){
            no = userInfoBean.getUno();
        }
        return no;
    }

    public String getCdNo(){
        String no ="";
        for (UserInfoBean userInfoBean : records){
            no = userInfoBean.getCdno();
        }
        return no;
    }

}
